package com.daodaofun.weibo.service;


import com.daodaofun.util.PageInfo;
import com.daodaofun.weibo.dto.UserDto;
import com.daodaofun.weibo.model.User;

import java.util.List;
import java.util.Set;

public interface UserService {
    void save(User user);

    User findByUsername(String username);

    List<Long> findMasters(Long userId);

    List<UserDto> findByUsernameLike(String content);

    /**
     *
     * @param of
     * @param followdId  主动操作的用户id（关注，取消关注）
     * @param startId   被关注的id
     */
    void starOnOrOff(Integer of, Long followdId, Long startId);

    Set<String> findFollows(Long userId);

    Set<String> findFans(Long userId,Integer pageNum);

    /**
     * 统计当前用户关注者的数量
     * @param id
     * @return
     */
    long countFollows(Long id);

    /**
     * 统计当前用户的粉丝的数量
     * @param id
     * @return
     */
    long countFans(Long id);

    List<UserDto> findFollowsUser(Long id);


    int isRedisSyncToMysql(Long id);


    PageInfo<UserDto> findFansUser(Long id, Integer pageNum);

    long findFansTotal(Long id);
}
